<!doctype html>
<html>
{include file="head.html"}

<body>
<div class="header">
	 <a href="{$appshop}?m=index"  class="left-btn"><span class="iconfont icon-back"></span></a>
    <div class="title">管理区域</div>
</div>
<style>
	.m-sqsites{ padding:10px;}
	.m-sqsites .sqsites{margin-bottom:5px;}
	.m-sqsites .sqsites .hd{height:40px; line-height:40px; border-bottom:1px solid #ccc; margin-bottom:5px; padding-left:10px;}
	.m-sqsites .sqsites .item{ display:block; float:left; margin-left:10px; border:1px solid #ccc; padding:5px; cursor:pointer; margin-bottom:20px;}
	.m-sqsites .sqsites .item.active{background-color:#f60; color:#fff;}
</style>
<div class="m-sqsites">
	{foreach item=c from=$sitearea}
    	<div class="sqsites">
        	<div class="hd">{$c.title}</div>
            {foreach item=cc from=$c.sites}
            	<div class="item sqsites-item {if $cc.issq}active{/if}" siteid="{$cc.siteid}">
                	{$cc.sitename}
                </div>
            	
            {/foreach}
            <div class="clearfix"></div>
        </div>
    {/foreach}
</div>
<script>
	$(function(){
		$(document).on("click",".sqsites-item",function(){
			var obj=$(this);
			$.get("{$appshop}?m=shop_sqsites&a=save&ajax=1",{
				siteid:$(this).attr("siteid")
			},function(data){
				if(data.data==1){
					obj.addClass("active");
				}else{
					obj.removeClass("active");
				}
			},"json")
			
		});
	})
</script>
</body>
</html>
